{extend name="public/base"}
{block name="main"}
{eq name="cid" value="0"}
{include file="public/overview"}
{else /}
<div class="layui-tab layui-tab-brief" lay-filter="demoTitle">
    <ul class="layui-tab-title site-demo-title">
        <li class="layui-this category-name"></li>
    </ul>
    <div class="layui-body layui-tab-content site-demo site-demo-body">
        <div class="layui-tab-item layui-show">
            <div class="layui-main">
                <div id="LAY_preview">
                    <table class="layui-table" lay-even="" lay-skin="nob" id="data_list">
                    </table>
                </div>
                <div id="demo1">
                </div>
            </div>
        </div>
    </div>
</div>
{/eq}
{/block}

{block name="javascript"}
<script>
    layui.use(['laypage', 'layer', 'form'], function() {
        var laypage = layui.laypage, $ = layui.jquery, form = layui.form()
                , layer = layui.layer;

        laypage({
            cont: 'demo1'
            , pages: '{php}echo ceil($data["total"] / $data["per_page"]);{/php}' //总页数
            , skip: true //连续显示分页数
        });

        form.on('select(pid)', function(data){
            window.location.href = '/api/document/api_list/cid/' + data.value;
        });
        var cid = {$cid};
        $(".category-name").text($('dd[data-cid="'+ cid +'"]').find('a').text());

        get_list(0);
    });
</script>
{/block}